package com.bbs.utils;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

@Accessors(chain = true)
@NoArgsConstructor
@ToString
@Data
public class SystemResult<T> {

    private Integer code;

    private Integer count;

    private String msg;

    private T data;


    public SystemResult(Integer code,String message){
        this.code=code;
        this.msg=message;
    }

    public SystemResult(Integer code,String message,T data,Integer count){
        this.code=code;
        this.data=data;
        this.msg=message;
        this.count=count;
    }

    public SystemResult(Integer code,String message,T data){
        this.code=code;
        this.data=data;
        this.msg=message;
    }

    public static final SystemResult RESPONSE_RESULT=new SystemResult(SystemEnum.RESULT_OK.getCode(),SystemEnum.RESULT_OK.getMessage(),null,0);

}
